import requests
import json
url = "https://limsuat.midea.com/LIMS-Server/MPLM_Service_Gateway/TokenGenerator/getToken"
headers = {
    "__TokenAuthorization_UserName_": "cuiml10",
    "__TokenAuthorization_Function_": "getTestForm"
}

try:
    response = requests.post(url, headers=headers)
    print("状态码:", response.status_code)
    print("响应内容:", response.text)
    token = response.json().get("token", "")
    print("提取到的token:", token)
    data = json.loads(response.text)
    # 提取token值
    token = data.get("token", "")
    print("提取到的token:", token)
except Exception as e:
    print("请求出错:", str(e))
